//
//  BillTableViewCell.m
//  work
//
//  Created by 徐宏飞 on 16/6/1.
//  Copyright © 2016年 方伟. All rights reserved.
//

#import "BillTableViewCell.h"
#import "BillModel.h"

@interface BillTableViewCell ()


@property (weak, nonatomic) IBOutlet UILabel *lblDate;
@property (weak, nonatomic) IBOutlet UILabel *lblMoneyCount;
@property (weak, nonatomic) IBOutlet UILabel *lblAddress;
@property (weak, nonatomic) IBOutlet UILabel *lblType;

@property (weak, nonatomic) IBOutlet UILabel *lblFee;



@end

@implementation BillTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}


-(void)setModel:(BillModel *)model{
    _model = model;
    
    if (_model.fee.intValue) {
        self.lblFee.text = [NSString stringWithFormat:@"(手续费%@元)", _model.fee];
    } else {
        self.lblFee.text = @"";
    }
    
    self.lblMoneyCount.text = [NSString stringWithFormat:@"%ld", (long)_model.balance_withdrawing.integerValue];
    
    
    if ([_model.type isEqualToString:@"withdraw_accepted"]) {//提现成功
        self.lblType.text = @"提现成功";
        self.lblType.textColor = [UIColor orangeColor];
        self.lblAddress.text = @"提现至 尾号0001银行卡";
    } else if ([_model.type isEqualToString:@"withdraw_submiting"]) {//提现中
        self.lblType.text = @"提现中";
        self.lblType.textColor = [UIColor lightGrayColor];
        self.lblAddress.text = @"提现至 尾号0002银行卡";
    } else if ([_model.type isEqualToString:@"withdraw_failed"])  {//提现失败
        self.lblType.text = @"提现失败";
        self.lblType.textColor = [UIColor redColor];
        self.lblAddress.text = [NSString stringWithFormat:@"%@", _model.remark];//拒绝原因
    } else {//收入
        self.lblType.text = @"收入";
        self.lblType.textColor = COLOR_THEHE;
        self.lblAddress.text = [NSString stringWithFormat:@"%@", _model.remark];//收入类别

        
    }
    
    self.lblDate.text = [NSString getBeijingDayWithStrTime:_model.create_time];
    
    
    
}





- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
